﻿/****** Object:  Table [dbo].[sar_SearchAndReplace]    Script Date: 08/16/2010 13:42:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[sar_SearchAndReplace](
	[Id] [uniqueidentifier] NOT NULL,
	[StartPage] [nvarchar](50) NOT NULL,
	[Created] [datetime] NOT NULL,
	[CreatedBy] [nvarchar](100) NOT NULL,
	[Find] [nvarchar](1024) NOT NULL,
	[Replace] [nvarchar](1024) NOT NULL,
	[MatchCase] [bit] NOT NULL,
	[UpdateDynamicProperties] [bit] NOT NULL,
	[SearchWithinWords] [bit] NOT NULL,
	[StartPageOnly] [bit] NOT NULL,
	[LanguageBranch] [nvarchar](50) NOT NULL,
	[Completed] [bit] NOT NULL,
 CONSTRAINT [PK_sar_SearchAndReplace] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[sar_Page]    Script Date: 08/16/2010 13:42:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[sar_Page](
	[Id] [uniqueidentifier] NOT NULL,
	[SearchAndReplaceId] [uniqueidentifier] NOT NULL,
	[PageId] [int] NOT NULL,
	[WorkId] [int] NOT NULL,
	[PreviousWorkId] [int] NOT NULL,
	[LanguageBranch] [nvarchar](50) NOT NULL,
	[SortIndex] [int] NOT NULL,
 CONSTRAINT [PK_sar_Page] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[sar_DynamicProperty]    Script Date: 08/16/2010 13:42:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[sar_DynamicProperty](
	[Id] [uniqueidentifier] NOT NULL,
	[SearchAndReplaceId] [uniqueidentifier] NOT NULL,
	[PageId] [int] NOT NULL,
	[WorkId] [int] NOT NULL,
	[LanguageBranch] [nvarchar](50) NOT NULL,
	[PropertyName] [nvarchar](100) NOT NULL,
	[SortIndex] [int] NOT NULL,
 CONSTRAINT [PK_sar_DynamicProperty] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  ForeignKey [FK_sar_DynamicProperty_sar_SearchAndReplace]    Script Date: 08/16/2010 13:42:53 ******/
ALTER TABLE [dbo].[sar_DynamicProperty]  WITH CHECK ADD  CONSTRAINT [FK_sar_DynamicProperty_sar_SearchAndReplace] FOREIGN KEY([SearchAndReplaceId])
REFERENCES [dbo].[sar_SearchAndReplace] ([Id])
GO
ALTER TABLE [dbo].[sar_DynamicProperty] CHECK CONSTRAINT [FK_sar_DynamicProperty_sar_SearchAndReplace]
GO
/****** Object:  ForeignKey [FK_sar_Page_sar_SearchAndReplace]    Script Date: 08/16/2010 13:42:53 ******/
ALTER TABLE [dbo].[sar_Page]  WITH CHECK ADD  CONSTRAINT [FK_sar_Page_sar_SearchAndReplace] FOREIGN KEY([SearchAndReplaceId])
REFERENCES [dbo].[sar_SearchAndReplace] ([Id])
GO
ALTER TABLE [dbo].[sar_Page] CHECK CONSTRAINT [FK_sar_Page_sar_SearchAndReplace]
GO

/****** Object:  Table [dbo].[sar_Error]    Script Date: 08/16/2010 13:42:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[sar_Error](
	[Id] [uniqueidentifier] NOT NULL,
	[SearchAndReplaceId] [uniqueidentifier] NOT NULL,
	[PageId] [int] NOT NULL,
	[WorkId] [int] NOT NULL,
	[LanguageBranch] [nvarchar](50) NOT NULL,
	[PropertyName] [nvarchar](100) NOT NULL,
	[ErrorMessage] [nvarchar](1024) NOT NULL,
	[PageProperty] [bit] NOT NULL,
	[SortIndex] [int] NOT NULL,
 CONSTRAINT [PK_sar_Error] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  ForeignKey [FK_sar_Error_sar_SearchAndReplace]    Script Date: 08/16/2010 13:42:53 ******/
ALTER TABLE [dbo].[sar_Error]  WITH CHECK ADD  CONSTRAINT [FK_sar_Error_sar_SearchAndReplace] FOREIGN KEY([SearchAndReplaceId])
REFERENCES [dbo].[sar_SearchAndReplace] ([Id])
GO
ALTER TABLE [dbo].[sar_Error] CHECK CONSTRAINT [FK_sar_Error_sar_SearchAndReplace]
GO
